rbm-publish(1)
==============

NAME
----
rbm-publish - Publish some packages or files


SYNOPSIS
--------
[verse]
'rbm publish' <project> [--publish-src-dir=<dir>] [options]

DESCRIPTION
-----------

Build a package and publish it. See link:rbm-pkg.html[rbm-pkg(1)]
for details about how the package is built.

If the option '--publish-src-dir' is used, then the package is not built,
and instead the packages or files present in that directory are published.

CONFIGURATION OPTIONS
---------------------

include::options_publish.asc[]

See link:rbm_config.html[rbm_config(7)] for all other options.

COMMAND LINE OPTIONS
--------------------
The command line options related to publish are :

include::clioptions_publish.asc[]

See link:rbm_cli.html[rbm_cli(7)] for all other options.

EXAMPLES
--------

In this example, we want to publish packages for Mageia and Debian. On
Mageia, the repository metadata are generated using 'genhdlist2'. On
Debian the new package is included in the repository using 'reprepro'.

The rbm configuration looks like this :
----
targets:
  Mageia:
    repo_dir: /path/to/mageia/repo
    publish: |
     #!/bin/sh
     cp -va noarch/*.rpm [% c('repo_dir') %]
     genhdlist2 [% c('repo_dir') %]
  Debian:
    repo_dir: /path/to/debian/repo
    publish: |
      #!/bin/sh
      reprepro -b [% c('repo_dir') %] include \
                  [% c('lsb_release/codename') %] *.changes
----

If we want to upload the packages on a remote server, before including
them on the repository, this can be done like this :

----
targets:
  Debian:
    repo_dir: /path/to/debian/repo
    publish: |
      #!/bin/sh
      reprepro -b [% c('repo_dir') %] include \
                  [% c('lsb_release/codename') %] *.changes
steps:
  publish:
    ssh_host: publish_server.somedomain
    remote_exec: "[% c('remote_ssh') %]"
----

An alternative could be to generate the repository locally, and add an
rsync command at the end of the 'publish' script to upload the repository
to your publication server :

----
targets:
  Debian:
    local_repo: /path/to/debian/repo
    publish: |
      #!/bin/sh
      reprepro -b [% c('local_repo') %] include \
                  [% c('lsb_release/codename') %] *.changes
      rsync -avH --delete [% c('local_repo') %] publish_server.somedomain:/repo
----

SEE ALSO
--------
link:rbm.html[rbm(1)],
link:rbm-pkg.html[rbm-pkg(1)]
